import request from '@/utils/request'


export interface navListModel {
    id?: string,
    picUrl: string,
    mainTitle: string,
    viceTitle: string,
    columnUrl: string,
    onlineType: boolean,
    vaildStartTime: number,
    vaildEndTime: number,
    rank: number
}

export interface bannerModel {
    checkNavType: boolean,
    navList: navListModel[],
    delNavId: null
}




export interface lookPicsModel {
    picUrl: string,
    isVideo: boolean,
    videoUrl: string,
    size: number,
    duration: number,
    tagInfo: string,
    height: number,
    width: number
}
export interface lookModel {
    schemeUrl: string,
    title: string,
    topicId: number,
    nickname: string,
    avatar: string,
    content: string,
    lookPics: lookPicsModel[],
    readCount: number,
    appBanHeight: number,
    appBanWidth: number,
    picUrl: string
}
export interface topicsModel {
    topicId: number,
    type: number,
    pubType: number,
    schemeUrl: string,
    nickname: string,
    avatar: string,
    readCount: number,
    style: number,
    title: string,
    subTitle: string,
    picUrl: string,
    hasVideo: boolean,
    hasLookCollects: boolean,
    videoUrl: null,
    size: number,
    duration: number,
    width: number,
    height: number,
    itemList: null,
    buyNow: null,
    itemIdList: number[],
    lookList: null,
    statusValid: boolean,
    status: string,
    wapStatus: string,
    appStatus: string,
    topicExtend: null,
    content: null,
    appBanHeight: number,
    appBanWidth: number,
    pcBannerSize: null,
    topType: boolean,
    categoryIds: string,
    layoutType: number,
    timeStamp: number,
    newAppBanner: string,
    newAppBannerWidth: number,
    newAppBannerHeight: number,
}

export interface recAutoListModel {
    topics: topicsModel[]
}

export interface recAutoModel {
    hasMore: boolean,
    result: recAutoListModel[],
}

export default {
    bannerList() {
        return request.get<any, bannerModel>(`topic/v1/know/navWap.json`)
    },
    recAuto(page: string | number, size: string | number) {
        return request.get<any, recAutoModel>(`topic/v1/find/recAuto.json`, {
            params: {
                page,
                size
            }
        })
    },
    findflauntInfo(data: any) {
        return request.get<any, any>(`/topic/v1/look/getList.json?page=${data.page}&size=${data.size}&type=${data.type}`)
    }
}
